<template>
  <div class="userinfo">
      <navbar></navbar>
      <img  class="backimg" src="@/assets/img/bj.jpg" alt="">
      <div>
          <user-detail :userInfo="model"></user-detail>
      </div>
      <user-article></user-article>
  </div>
</template>

<script>
import Navbar from '@/components/common/Navbar'
import userDetail from '@/components/userComponent/userDetail'
import userArticle from '@/components/userComponent/userArticle'
export default {
    data () {
      return {
        model: {}
      }
    },
    methods: {
      async UserInfoData () {
        const res = await this.$http.get('/user/'+ localStorage.getItem('id'))
        this.model = res.data[0]
      }
    },
    components: {
        Navbar,
        userDetail,
        userArticle
    },
    created () {
      this.UserInfoData()
    }
}
</script>

<style lang="stylus" scoped>
  .userinfo
    .backimg
      height 121px
      width 100%
    
</style>